//
//  KillNumberTools.m
//  TheRicher
//
//  Created by 李晓东 on 2018/2/2.
//  Copyright © 2018年 PeanutXu. All rights reserved.
//

#import "KillNumberTools.h"

#define ShuangSeQiuHongQiu 6
@interface KillNumberTools ()

@end
@implementation KillNumberTools

+ (instancetype)share{
    static KillNumberTools *tools = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        tools = [[KillNumberTools alloc]init];
    });
    return tools;
}

/**
 查询是否在 type1的属性上有值.如果有的话,就添加到 killingNumber属性上;
 如果没有,就通过运算,计算出 killingNumber 值.再添加到needHandleObjs数组中,返回给 delegate.
 再在

 @param originArray 数据库结果集
 @return 处理后的结果集
 */
- (NSArray *)type1:(NSArray *)originArray{
//    NSMutableArray *needHandleObjs = [NSMutableArray array];
    self.needHandleObjs = [NSMutableArray array];
    for (ShuangSeQiu *obj in originArray) {
        if ([self judgaNeedHandleObj:obj andCondition:obj.type1]) {
//            [obj setKillingNumber:obj.type1];
            continue;
            
        }
//        if ([obj.type1 length] > 0) {
//            [obj setKillingNumber:obj.type1];
//            continue;
//        }
        NSInteger killingNumber = 0;
        NSArray *redBalls = [obj.number componentsSeparatedByString:@" "];
        for (NSString *redBall in redBalls) {
            killingNumber += [[NSString stringWithFormat:@"%C", [redBall characterAtIndex:0]] integerValue] + [[NSString stringWithFormat:@"%C", [redBall characterAtIndex:1]] integerValue];
        }
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", [self checkIfLargeThan33:killingNumber]]];
//        [needHandleObjs addObject:obj];
    }

    [super callDelegate];
    return originArray;
}

- (NSArray *)type2:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (ShuangSeQiu *obj in originArray) {
        if ([self judgaNeedHandleObj:obj andCondition:obj.type2]) {
            continue;
            
        }
        NSInteger killingNumber = 0;
        NSArray *redBalls = [obj.number componentsSeparatedByString:@" "];
        for (NSString *redBall in redBalls) {
            killingNumber += [[NSString stringWithFormat:@"%C", [redBall characterAtIndex:0]] integerValue] + [[NSString stringWithFormat:@"%C", [redBall characterAtIndex:1]] integerValue];
        }
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", [self checkIfLargeThan33:killingNumber]]];
//        [needHandleObjs addObject:obj];
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type3:(NSArray *)originArray {
    self.needHandleObjs = [NSMutableArray array];
    NSMutableArray *calculateArray = [NSMutableArray array];
    // 循环每一个 ShuangSeQiu
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type3]) {
            continue;
            
        }
        NSArray *tempObjArray = [[obj number] componentsSeparatedByString:@" "];
        NSMutableArray *mutableArray = [NSMutableArray array];
        for (int i = 0; i < ShuangSeQiuHongQiu; i++) {
            for (int j = i; j < ShuangSeQiuHongQiu; j++) {
                NSInteger afterNum = [NSString stringWithFormat:@"%@", tempObjArray[j]].integerValue;
                NSInteger beforeNum = [NSString stringWithFormat:@"%@", tempObjArray[i]].integerValue;
                
                NSInteger value = afterNum - beforeNum;
                if (![mutableArray containsObject:[NSString stringWithFormat:@"%ld", value]] && value != 0) {
                    [mutableArray addObject:[NSString stringWithFormat:@"%ld", (long)value]];
                }
                
            }
            
        }
        NSInteger result = mutableArray.count - (6 - 1);
        
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", result]];
        [calculateArray addObject:obj];
    }
    [super callDelegate];
    return calculateArray;
    
}

- (NSArray *)type4:(NSArray *)originArray{
    
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];

        NSArray *tempObjArray = [[obj number] componentsSeparatedByString:@" "];
        NSMutableArray *mutableArray = [NSMutableArray array];
        for (int i = 0; i < ShuangSeQiuHongQiu; i++) {
            for (int j = i; j < ShuangSeQiuHongQiu; j++) {
                NSInteger afterNum = [NSString stringWithFormat:@"%@", tempObjArray[j]].integerValue;
                NSInteger beforeNum = [NSString stringWithFormat:@"%@", tempObjArray[i]].integerValue;
                
                NSInteger value = afterNum - beforeNum;
                if (![mutableArray containsObject:[NSString stringWithFormat:@"%ld", value]] && value != 0) {
                    [mutableArray addObject:[NSString stringWithFormat:@"%ld", (long)value]];
                }
                
            }
            
        }
        NSInteger result = mutableArray.count - (6 - 1);
        
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", result]];
    }
    
    self.needHandleObjs = [NSMutableArray array];

    for (ShuangSeQiu *tempObj in originArray) {
        if ([self judgaNeedHandleObj:tempObj andCondition:tempObj.type4]) {
            continue;
        }
        [tempObj setKillingNumber:[NSString stringWithFormat:@"%02ld", [tempObj.blue integerValue] + [tempObj.killingNumber integerValue]]];
//        [needHandleObjs addObject:tempObj];
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type5:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int i = 0; i < originArray.count; i++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[i];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type5]) {
            continue;
        }
        NSArray *splitArray = [self splitAll:[obj.number componentsSeparatedByString:@" "]];
        NSInteger sum = 0;
        for (int i = 1; i < 12; i+=2) {
            sum += [splitArray[i] integerValue];
        }
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", sum]];
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type12:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (ShuangSeQiu *obj in originArray) {
        if ([self judgaNeedHandleObj:obj andCondition:obj.type12]) {
            continue;
        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        NSString *min, *max;
        Boolean minFlag = NO , maxFlag = NO;
        for (int i = 0; i < splitArray.count; i++) {
            if ([(NSString *)splitArray[i] integerValue] % 2 != 0 && !minFlag) {
                min = splitArray[i];
                minFlag = YES;
            }
            
            if ([(NSString *)splitArray[splitArray.count - i - 1] integerValue] %2 != 0 && !maxFlag) {
                max = splitArray[splitArray.count - i - 1];
                maxFlag = YES;
            }
            
        }
        NSInteger value = ([max integerValue] - [min integerValue]) / 2;
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", value]];
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type13:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (ShuangSeQiu *obj in originArray) {
        if ([self judgaNeedHandleObj:obj andCondition:obj.type13]) {
            continue;
        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        NSString *min, *max;
        Boolean minFlag = NO , maxFlag = NO;
        for (int i = 0; i < splitArray.count; i++) {
            if ([(NSString *)splitArray[i] integerValue] % 2 != 0 && !minFlag) {
                min = splitArray[i];
                minFlag = YES;
            }
            
            if ([(NSString *)splitArray[splitArray.count - i - 1] integerValue] %2 != 0 && !maxFlag) {
                max = splitArray[splitArray.count - i - 1];
                maxFlag = YES;
            }
            
        }
        NSInteger value = ([max integerValue] + [min integerValue]) / 2;
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", value]];
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type14:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = originArray.count; k > 1; k--) {
        
        ShuangSeQiu *operationObj = (ShuangSeQiu *)originArray[k - 2];
        ShuangSeQiu *beOperationObj = (ShuangSeQiu *)originArray[k - 1];
        
        if ([self judgaNeedHandleObj:operationObj andCondition:operationObj.type14]) {
            continue;
        }
        
        NSString *operationObjBlueBall = operationObj.blue;
        NSString *beOperationObjBlueBall = beOperationObj.blue;
        
        NSMutableString *mutableString = [NSMutableString string];
        
        [mutableString appendString:[NSString stringWithFormat:@"%02ld, ", [operationObjBlueBall integerValue] + [beOperationObjBlueBall integerValue]]];
        [mutableString appendString:[NSString stringWithFormat:@"%02ld", ABS([operationObjBlueBall integerValue] - [beOperationObjBlueBall integerValue])]];
        
//        ShuangSeQiu *shuangSeQiu = (ShuangSeQiu *)originArray[k - 3];
        [operationObj setKillingNumber:mutableString];
    }
    
//    originArray = [originArray subarrayWithRange:NSMakeRange(0, originArray.count - 1)];
    [super callDelegate];
    return originArray;
}

/// 从type15到 type20算法一样,只是操作的位数不同
- (void)type15To20:(NSArray *)originArray useRed:(NSInteger)redBall toPlus:(NSInteger)method inType:(NSString *)type{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSString *typeStr = nil;
        typeStr = @"say good";
        if ([type isEqualToString:@"type15"]) {
            typeStr = obj.type15;
        } else if ([type isEqualToString:@"type16"]) {
            typeStr = obj.type16;
        } else if ([type isEqualToString:@"type17"]) {
            typeStr = obj.type17;
        } else if ([type isEqualToString:@"type18"]) {
            typeStr = obj.type18;
        } else if ([type isEqualToString:@"type19"]) {
            typeStr = obj.type19;
        } else if ([type isEqualToString:@"type20"]) {
            typeStr = obj.type20;
        }
        if ([self judgaNeedHandleObj:obj andCondition:typeStr]) {
            continue;
        }
        
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        [obj setKillingNumber: [NSString stringWithFormat:@"%02ld", [self checkIfLargeThan33:[splitArray[redBall] integerValue] + method]]];
    }
    [super callDelegate];
}

- (NSArray *)type15:(NSArray *)originArray{
    [self type15To20:originArray useRed:0 toPlus:9 inType:@"type15"];
    return originArray;
}

- (NSArray *)type16:(NSArray *)originArray{
    [self type15To20:originArray useRed:0 toPlus:2 inType:@"type16"];
    return originArray;
}

- (NSArray *)type17:(NSArray *)originArray{
    [self type15To20:originArray useRed:1 toPlus:5 inType:@"type17"];
    return originArray;
}

- (NSArray *)type18:(NSArray *)originArray {
    [self type15To20:originArray useRed:2 toPlus:7 inType:@"type18"];
    return originArray;
}

- (NSArray *)type19:(NSArray *)originArray {
    [self type15To20:originArray useRed:2 toPlus:4 inType:@"type19"];
    return originArray;
}

- (NSArray *)type20:(NSArray *)originArray {
    [self type15To20:originArray useRed:5 toPlus:4 inType:@"type20"];
    return originArray;
}

//
- (NSArray *)type21:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type21]) {
            continue;
        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld",  [self checkIfLargeThan33:[splitArray[0] integerValue] * 4 - 2]]];
        
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type22:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type22]) {
            continue;
        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld",  [self checkIfLargeThan33:[splitArray[0] integerValue] + [obj.blue integerValue]]]];
        
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type23:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type23]) {
            continue;
        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld",  [self checkIfLargeThan33:[obj.blue integerValue] + [splitArray[1] integerValue] - 1]]];
        
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type24:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type24]) {
            continue;
        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", [self checkIfLargeThan33:[obj.blue integerValue] * [splitArray[0] integerValue]]]];
        
    }
    [super callDelegate];
    return originArray;
}

- (NSArray *)type25:(NSArray *)originArray{
    [self type25To27:originArray multiply:1 andAdd:7 inType:@"type25"];
    return originArray;
}

- (NSArray *)type26:(NSArray *)originArray{
    [self type25To27:originArray multiply:1 andAdd:9 inType:@"type26"];
    return originArray;
}

- (NSArray *)type27:(NSArray *)originArray{
    [self type25To27:originArray multiply:5 andAdd:2 inType:@"type27"];
    return originArray;
}

// MARK: 从25到27之间的方法抽取
- (void)type25To27:(NSArray *)originArray multiply:(NSInteger)multiply andAdd:(NSInteger)add  inType:(NSString *)type{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSString *typeStr = nil;
        if ([type isEqualToString:@"type25"]) {
            typeStr = obj.type25;
        } else if ([type isEqualToString:@"type26"]) {
            typeStr = obj.type26;
        } else if ([type isEqualToString:@"type27"]) {
            typeStr = obj.type27;
        }
        if ([self judgaNeedHandleObj:obj andCondition:typeStr]) {
            continue;
        }

        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", [self checkIfLargeThan33:[obj.blue integerValue] * multiply + add]]];
        
    }
    [super callDelegate];
}

- (NSArray *)type28:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type28]) {
            continue;
        }
//        if ([obj.type28 length] > 0) {
//            [obj setKillingNumber:obj.type28];
//            continue ;
//        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        [obj setKillingNumber:[NSString stringWithFormat:@"%02ld", [splitArray[5] integerValue] - [obj.blue integerValue]]];
//        [needHandleObjs addObject:obj];

    }
    [self callDelegate];
    return originArray;
}


- (NSArray *)type29:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type29]) {
            continue;
        }

        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        NSString *num = [NSString stringWithFormat:@"%ld", [splitArray[5] integerValue] - [obj.blue integerValue]];
        
        NSInteger numToInteger = [num integerValue] < 10 ? [num integerValue] : [[NSString stringWithFormat:@"%C", [num characterAtIndex:0]] integerValue] + [[NSString stringWithFormat:@"%C", [num characterAtIndex:1]] integerValue];
        
        
        NSString *result = [self checkInTableOfComparisons:[NSString stringWithFormat:@"%02ld", numToInteger]];
        [obj setKillingNumber:result];
//        [needHandleObjs addObject:obj];

    }
    [self callDelegate];
    return originArray;
}

- (NSArray *)type32:(NSArray *)originArray{
    self.needHandleObjs = [NSMutableArray array];
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        if ([self judgaNeedHandleObj:obj andCondition:obj.type32]) {
            continue;
        }
        NSArray *splitArray = [obj.number componentsSeparatedByString:@" "];
        NSString *num = [NSString stringWithFormat:@"%02ld", [self checkIfLargeThan33:34 - [splitArray[0] integerValue]]];
        [obj setKillingNumber:num];
//        [needHandleObjs addObject:obj];
    }
    [self callDelegate];
    return originArray;
}

- (NSInteger)checkIfLargeThan33:(NSInteger)num{
    NSInteger multiple = num / 33;
    return num > 33 ? num - multiple * 33 : num;
}

- (NSArray *)splitAll:(NSArray *)originArray{
    NSMutableArray *splitArray = [NSMutableArray arrayWithCapacity:14];
    for (NSString *tempStr in originArray) {
        for (int i = 0; i < tempStr.length; i++) {
            [splitArray addObject:[NSString stringWithFormat:@"%C", [tempStr characterAtIndex:i]]];
        }
        
    }
    return splitArray;
}

// MARK: 比较11对照码
- (NSString *)checkInTableOfComparisons:(NSString *)num{
    NSDictionary *dict = @{@"01":@"12,23", @"02":@"13,24", @"03":@"14,25", @"04":@"15,26", @"05":@"16,27", @"06":@"17,28", @"07":@"18,29", @"08":@"19,30", @"09":@"20,31", @"10":@"21,32", @"11":@"22,33"};
    NSString *result = [dict objectForKey:num];
    return result;
}

// MARK: 降龙十八掌 系列
- (NSArray *)method2:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[0] integerValue] + [splitArray[1] integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method3:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[1] integerValue]  - [splitArray[0] integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method4:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[3] integerValue]  + [splitArray[0] integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method5:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[4] integerValue]  - [splitArray[2] integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method6:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[5] integerValue]  - [splitArray[1] integerValue] + 1];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method7:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[5] integerValue]  - [splitArray[1] integerValue] + 10];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method8:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[3] integerValue]  - [splitArray[0] integerValue] + 7];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method9:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[0] integerValue] + 12];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method10:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33: [splitArray[5] integerValue]  - [splitArray[0] integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method11:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[5] integerValue] + [splitArray.lastObject integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method12:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:([splitArray[0] integerValue]  + [splitArray[1] integerValue] + [splitArray[2] integerValue]) / 3];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method13:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:([splitArray[1] integerValue]  + [splitArray[2] integerValue] + [splitArray[3] integerValue] + [splitArray[4] integerValue] + [splitArray.lastObject integerValue]) / 6];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}
- (NSArray *)method14:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:([splitArray[2] integerValue] + [splitArray[3] integerValue] + [splitArray[4] integerValue] + [splitArray[5] integerValue]) / 4 ];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method15:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[1] integerValue] + [splitArray.lastObject integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method16:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[1] integerValue] + [splitArray[2] integerValue]];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method17:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[4] integerValue]  - [splitArray[3] integerValue] + 10];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

- (NSArray *)method18:(NSArray *)originArray{
    for (int k = 0; k < originArray.count; k++) {
        ShuangSeQiu *obj = (ShuangSeQiu *)originArray[k];
        NSArray *splitArray = [[obj number] componentsSeparatedByString:@" "];
        NSInteger tempInteger = [self checkIfLargeThan33:[splitArray[1] integerValue] + [splitArray[5] integerValue] + 1];
        obj.killingNumber = [NSString stringWithFormat:@"%02ld", tempInteger];
    }
    return originArray;
}

@end
